<template>
  <div id="reports">

  </div>
</template>
<script>
import { ref, reactive, toRefs, onMounted } from 'vue'
import * as echarts from 'echarts';
export default {
  setup(props) {
    const option = reactive({
      tooltip: {
        trigger: 'item'
      },
      legend: {
        top: '5%',
        left: 'center'
      },
      series: [
        {
          name: 'Access From',
          type: 'pie',
          radius: ['50%', '100%'],
          avoidLabelOverlap: false,
          itemStyle: {
            borderRadius: 10,
            borderColor: '#fff',
            borderWidth: 2
          },
          label: {
            show: false,
            position: 'center'
          },
          emphasis: {
            label: {
              show: true,
              fontSize: '40',
              fontWeight: 'bold'
            }
          },
          labelLine: {
            show: false
          },
          data: [
            { value: 1048, name: '真帅' },
            { value: 735, name: '太帅了' },
            { value: 580, name: '酷毙了' },
            { value: 484, name: '爱死你了' },
            { value: 300, name: '灰太狼' }
          ]
        }
      ]
    })
    onMounted(() => {
      const chartDom = document.getElementById('reports');
      const myChart = echarts.init(chartDom);
      option && myChart.setOption(option);
    })
    return {}
  },
}
</script>
<style lang="scss" scoped>
#reports {
  width: 100%;
  height: 100%;
}
</style>
